package com.boot.core.result

class WebSocketResult {

    private var message = ""

    private var code = 1

    private var result: Any? = null

    fun getMessage(): String? {
        return message
    }

    fun setMessage(message: String) {
        this.message = message
    }

    fun getResult(): Any? {
        return result
    }

    fun setResult(obj: Any?) {
        result = obj
    }

    fun getCode(): Int {
        return code
    }

    fun setCode(code: Int) {
        this.code = code
    }

    fun WebSocketResult() {}

    fun WebSocketResult(result: Any?, code: Int, message: String) {
        this.result = result
        this.code = code
        this.message = message
    }

    fun successInstance() {
        return WebSocketResult(null, 1, "成功")
    }

    fun failInstance(message: String) {
        return WebSocketResult(null, -1, message)
    }


}